package com.algrithom.quene;

import java.util.ArrayDeque;
import java.util.LinkedList;
import java.util.Queue;

public class QueueOper {
    
    public static void main(String[] args){
        queueOper1();
        queueOper2();
    }
    
    private static void queueOper1(){
        Queue<Integer> queue = new LinkedList<>();
        queue.add(1);
        queue.add(2);
        System.out.println(queue.poll());
        System.out.println(queue.peek());
    }
    
    private static void queueOper2(){
        Queue<Integer> queue = new ArrayDeque<>();
        queue.offer(1);
        queue.offer(2);
        System.out.println(queue.poll());
        System.out.println(queue.poll());
    }
}
